//
//  Vertex.h
//  Min-Cut
//
//  Created by Emanuele Vespa on 3/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//


#include <iostream>
#include <list>



class Vertex {
    
       
public:
    
    int index;
    bool mark; // used for the BFS
    int key; // used in the min-cut algorithm

    
    std::list<Vertex *> contracted;

      
    bool setIndex( int value ){ return(index = value); }
    void addVertex(Vertex * v) { contracted.push_back(v); }
    int getIndex() const{ return index; }
    int getKey() const { return key; }
    int getContractedSize() { return contracted.size(); }
    void setKey(int k) { key = k; }
    bool isMarked() { return mark; }
    void setMark() { mark = true; }
    void unMark() { mark = false; }
  
    Vertex(){
        
        mark = false;
        
    }
    
    
        
    
    bool operator() ( const Vertex &v1, const Vertex &v2){
        
        if (v1.getKey() <= v2.getKey()) return true;
        else return false;
        
    }
    
    bool operator== ( Vertex v ) {
        
        return v.getIndex() == index ? true : false; 
    }
    
    
    
};